﻿<UserControl x:Class="TestClient.UserControls.ColumnInformationSave"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:ExtendedGridControl="clr-namespace:ExtendedGrid.ExtendedGridControl;assembly=ExtendedGrid"
             xmlns:ExtendedColumn="clr-namespace:ExtendedGrid.ExtendedColumn;assembly=ExtendedGrid"
             xmlns:WpfToolkit="clr-namespace:ExtendedGrid.Microsoft.Windows.Controls;assembly=ExtendedGrid"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <!--Attach Default Fluent Control's Theme-->
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
            </ResourceDictionary.MergedDictionaries>

        </ResourceDictionary>
    </UserControl.Resources>
    <StackPanel>
        <StackPanel Orientation="Horizontal" Height="Auto" Margin="0,3,0,3" HorizontalAlignment="Center">
            <Button Margin="2" Click="GetColumnInformationClick">Get Column Information</Button>
            <Button Margin="2" Click="SetColumnInformationClick">Set Column Information</Button>
        </StackPanel>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            
            <ExtendedGridControl:ExtendedDataGrid x:Name="grid" ItemsSource="{Binding SourceTable}" AutoGenerateColumns="False" HideColumnChooser="False" CanUserAddRows="False"  >
                <WpfToolkit:DataGrid.Columns>
                    <ExtendedColumn:ExtendedDataGridTextColumn Header="Game Name" AllowAutoFilter="True"
                                           Binding="{Binding GameName}" />
                    <ExtendedColumn:ExtendedDataGridTextColumn Header="Creator" AllowAutoFilter="True"
                                           Binding="{Binding Creator}" />
                    <ExtendedColumn:ExtendedDataGridTextColumn Header="Owner"
                                           Binding="{Binding Owner}" AllowAutoFilter="True"/>
                    <ExtendedColumn:ExtendedDataGridTextColumn Header="Publisher"
                                           Binding="{Binding Publisher}" AllowAutoFilter="True"
                                           CanUserSort="False" Width="*"/>

                </WpfToolkit:DataGrid.Columns>
            </ExtendedGridControl:ExtendedDataGrid>
            <TextBox x:Name="txtXml" Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" IsReadOnly="True">

            </TextBox>
        </Grid>
        
    </StackPanel>
</UserControl>
